import React from 'react';

import { View, StyleSheet, Text } from 'react-native';
import theme from '../native-base-theme/variables';

export default ({ name, value, fontColor }) => (
  <View style={styles.itemContainer}>
    <View style={styles.itemLeftContainer}>
      <Text style={[styles.fontStyle, { color: fontColor !== undefined ? fontColor : 'white' }]}>{name}</Text>
    </View>
    {value != null && (
    <View style={styles.itemRightContainer}>
      <Text style={[styles.fontStyle, { color: fontColor !== undefined ? fontColor : 'white' }]}>{value}</Text>
    </View>
    )}
  </View>
);

const styles = StyleSheet.create({
  itemContainer: {
    padding: 8,
    flexDirection: 'row',
    alignItems: 'center',
  },
  itemLeftContainer: {
    flex: 2,
    marginRight: 5,
  },
  itemRightContainer: {
    flex: 4,
    flexWrap: 'wrap',
  },
  fontStyle: {
    fontSize: theme.myNormalFontSize,
  },
});
